package com.kensla.urbanairshipheliumpushforandroidtutorials;

import android.app.Application;
import android.util.Log;

import com.urbanairship.AirshipConfigOptions;
import com.urbanairship.Logger;
import com.urbanairship.UAirship;
import com.urbanairship.push.CustomPushNotificationBuilder;
import com.urbanairship.push.PushManager;

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this);

        UAirship.takeOff(this, options);
        Logger.logLevel = Log.VERBOSE;

        CustomPushNotificationBuilder cpnb = new CustomPushNotificationBuilder();
        cpnb.statusBarIconDrawableId = R.drawable.ic_launcher;
        cpnb.layout = R.layout.notification;
        cpnb.layoutIconDrawableId = R.drawable.ic_launcher;// custom layout icon
        cpnb.layoutIconId = R.id.icon;
        cpnb.layoutSubjectId = R.id.subject;
        cpnb.layoutMessageId = R.id.message;

        PushManager.shared().setNotificationBuilder(cpnb);
        PushManager.shared().setIntentReceiver(IntentReceiver.class);
    }
}